home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / TextHarvest / TextHarvest-Install.exe / {app} / ScrSampleAdv01.txt < prev    next >
Text File  |  2004-12-01  |  3KB  |  61 lines

  1. ;---------------------------------------------------------------------------
  2. ; Sample Parse-O-Matic Script for TextHarvest
  3. ;---------------------------------------------------------------------------
  4. ;
  5. ;   This script uses the LookupFile and Lookup commands to replace the
  6. ;   categories in the ThingsToDo.txt file.
  7. ;
  8. ;---------------------------------------------------------------------------
  9. ; Check settings. Please see the script file ScriptSample01.txt if you do
  10. ; not understand how this section works; the techniques are explained there.
  11. ;---------------------------------------------------------------------------
  12. Begin FirstLine = ''
  13.   FirstLine = 'N'
  14.   InputFileWanted = 'ThingsToDo.txt'
  15.   X = Len $OptionX $OptionY $OptionZ
  16.   Begin X <> 0
  17.     M1 = 'Please clear the /Keep /Delete and' $0A$0D
  18.     M2 = '/Control input boxes and try this'  $0A$0D
  19.     M3 = 'this script again.'
  20.     Stop M1 M2 M3
  21.   End
  22.   Begin $ActualIFN ~ InputFileWanted
  23.     M1 = 'Please try this script with the' $0A$0D
  24.     M2 = 'input file ' InputFileWanted
  25.     Stop M1 M2
  26.   End
  27.   ;
  28.   ;   Output a header
  29.   ;
  30.   SepLine = Padded '' 80 'Left' '-'
  31.   OutEnd SepLine
  32.   OutEnd 'Things To Do Today'
  33.   OutEnd SepLine
  34. End
  35.  
  36. ;---------------------------------------------------------------------------
  37. ; Get the data
  38. ;---------------------------------------------------------------------------
  39. Category    = $OutData[1 9]                 ; Get category
  40. Description = $OutData[10 999]              ; Get description
  41. TrimChar Category                           ; Remove left & right spaces
  42.  
  43. ;---------------------------------------------------------------------------
  44. ; Do the lookup
  45. ;---------------------------------------------------------------------------
  46. LookupFile 'MyTable' 'LufSample01.txt' 1 3  ; Specify table and columns
  47. RevCat = Lookup Category 'MyTable'          ; Look up the revised category
  48. RevCat = Padded RevCat 12 'Right'           ; Pad it out to 12 spaces
  49.  
  50. ;---------------------------------------------------------------------------
  51. ; Insert a blank line into the output whenever we get a new category
  52. ;---------------------------------------------------------------------------
  53. Begin PreviousCat <> RevCat
  54.   PreviousCat = RevCat                      ; Remember this category
  55.   OutNull                                   ; Skip a line
  56. End
  57.  
  58. ;---------------------------------------------------------------------------
  59. ; Output
  60. ;---------------------------------------------------------------------------
  61. OutEnd RevCat Description